package com.lnb.mapper;

import com.lnb.entity.Roles;
import com.lnb.entity.UserRoles;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liningbo
 * @since 2020-05-21
 */
public interface UserrolesMapper extends BaseMapper<UserRoles> {

	@Select("select * from roles where id in(select role_id from user_roles where user_id = #{uid})")
	List<Roles> getRolesByUserId(Integer uid);

	boolean removeRolesByUserId(@Param("userId")Integer userId, @Param("arr")String[] arr);

}
